<?php
/**
 * get
 */

use think\facade\Route;
use app\common\exception\ExceptionEmun;
use app\common\exception\SystemException;

/**
 * admin通用规则,
 */
Route::rule(':action/:controller', ':action/:controller')
     ->pattern(['controller' => '\D+', 'action' => '\D+']);

//resource
Route::resource('member', 'member');
Route::resource('memberGroup', 'memberGroup');
Route::resource('memberRule', 'memberRule');
Route::resource('memberMenu', 'memberMenu');
Route::resource('memberGroup', 'memberGroup');
Route::resource('plan', 'plan');

Route::resource('admin', 'admin');
Route::resource('article', 'article');
Route::resource('category', 'category');
Route::resource('rule', 'rule');
Route::resource('menu', 'menu');
Route::resource('group', 'group');
Route::resource('user', 'admin');
Route::resource('structure', 'structure');
Route::resource('post', 'post');
Route::resource('systemconfig', 'systemconfig');

//非法路由地址
Route::miss(function() {
    ExceptionEmun::throwException(SystemException::INVALID_ROUTE);
});

